/* http://www.apache.org/licenses/LICENSE-2.0 */
/* Many thanks to the writor of libaco Sen Han <00hnes@gmail.com> */

#ifndef __MCO_HEADER_INCLUDED__
#define __MCO_HEADER_INCLUDED__

#ifdef __x86_64__
#else
	#error "platform no support yet"
#endif

typedef void (*mco_cofuncp_t)(void);

extern void mco_thread_init(void);
extern void * mco_create(mco_cofuncp_t fp, void * arg, size_t stk_sz);
/* __attribute__((__no_sanitize_address__)) */
extern void mco_resume(void * co);
/* __attribute__((__no_sanitize_address__)) */
extern void mco_yield(void);
extern void * mco_get_arg(void);
extern void * mco_get_co(void);
extern int mco_is_end(void * co);
extern int mco_check_stack(void * mco_ptr);
extern void mco_destroy(void * co);

#endif
